package com.plant.consult.mapper;

import com.plant.consult.domain.BackgroundRecordVo;
import com.plant.consult.domain.Consult;
import com.plant.consult.domain.ConsultDetail;
import com.plant.consult.domain.ConsultRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ConsultRecordMapper {
    void insert(ConsultRecord consultRecord);
    @Select("select id from consult_record where con_id=#{conId} and del=0")
    Integer findById(ConsultRecord consultRecord);
    @Select("select * from consult_record where ph_id=#{phId} and del=0 and status=0")
    List<ConsultRecord> findUserId(Integer phId);

    ConsultRecord findConId(Long conId);
    @Update("update consult_record set status=1,end_time=#{endTime} where con_id=#{conId}")
    void over(ConsultRecord consultRecord);
    @Select("select * from consult_record where con_id=#{conId}")
    List<ConsultRecord> selectReply(Consult consult);

    List<BackgroundRecordVo> backgroundRecordSelect();
}
